package com.sqstudio.exercise.chapter3{
	
	import flash.events.Event;
	
	import org.papervision3d.objects.primitives.Cylinder;
	import org.papervision3d.view.BasicView;

	[SWF(width="800",height="600")]
	
	/**
	 *圆柱 
	 * @author Nestor
	 * 
	 */	
	public class CylinderExample extends BasicView
	{
		private var cylinder:Cylinder;
		public function CylinderExample(viewportWidth:Number=800, viewportHeight:Number=600, scaleToStage:Boolean=true, interactive:Boolean=false, cameraType:String="Target")
		{
			super(viewportWidth, viewportHeight, scaleToStage, interactive, cameraType);
			stage.frameRate = 40;
			init();
			this.startRendering();
		}
		
		private function init():void{
			this.cylinder = new Cylinder(null,100,300,16,12,-1,false,false);
			this.cylinder.localRotationX = 45;
			this.cylinder.material.doubleSided = true; //内壁
			scene.addChild(this.cylinder);
		}
		
		override protected function onRenderTick(event:Event=null):void
		{
			this.cylinder.localRotationY++;
			super.onRenderTick(event);
		}
	}
}